(defun player (cell ai)
  (let ((player (make-meatbag (x cell) (y cell) #'player-ai :controls *controls*
			 :color sdl:*green* :pic "&" 
			 :name "Dr. Dragon")))
    (setf (ai player) ai)
    player))
(defparameter *player-ai* (make-ai #'player-ai nil))


(defparameter *map-width* (rescale *screen-width*))
(defparameter *map-height* (- (rescale *screen-height*) 10))


(defun make-monster (cell monsters)
  (if (null monsters)
      (player cell *player-ai*)
      (make-meatbag (x cell) (y cell) #'monster-ai :pic "@"
		    :color (random-color) :name (format nil "Monster ~a"
							(length monsters))
		    :controls *controls*)))

(defparameter *map* (make-level 5 #'make-monster *map-width* *map-height*
				12
				#'silly-make-room
				#'silly-connect-rooms
				#'make-wall-thingy))



(game-loop *player-ai* *map*)